package st.business.tepth.business.user.busnumber.workholder.repair.finish;

import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import st.business.tepth.R;
import st.business.tepth.business.bean.CompleteInfoBean;
import st.business.tepth.config.ItemFields;
import st.shadow.library.ui.recycler.MultipleItemEntity;

/**
 * @author zhangyu
 * @date 2019/3/26
 */
public class RepairCompleteAdapter extends BaseMultiItemQuickAdapter<MultipleItemEntity,
        BaseViewHolder> {
    public static final int TYPE_1 = 1;
    public static final int TYPE_2 = 2;

    /**
     * Same as QuickAdapter#QuickAdapter(Context,int) but with
     * some initialization data.
     *
     * @param data A new list is created out of this one to avoid mutable list
     */
    public RepairCompleteAdapter(List<MultipleItemEntity> data) {
        super(data);
        addItemType(TYPE_1, R.layout.item_complete_check);
        addItemType(TYPE_2, R.layout.item_complete_check_un_edit);
    }

    @Override
    protected void convert(BaseViewHolder helper, MultipleItemEntity item) {
        CompleteInfoBean.Info info = item.getField(ItemFields.ITEM_OBJ);
        helper.setText(R.id.cb_classification, info.getVehicle_series_name());
        helper.setText(R.id.tv_trouble, info.getPhenomenon_name());
        helper.setText(R.id.tv_warn_record, "无");
        helper.setText(R.id.tv_work_content, info.getWork_content());
    }
}
